package muse.frames;

import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import muse.Frame;
import muse.widgets.*;

public class Portal extends Frame {
    public Portal() {
            
        //##--##--##--##--##--##--##--##--##--##--####
        //--                                        ##
        //##                                        ##
        //------------------------------------------##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //--                                        ##
        //##                                        ##
        //------------------------------------------##
        //##                    --                  ##
        //--                    --                  ##
        //##                    --                  ##
        //--                    --                  ##
        //##                    --                  ##
        //------------------------------------------##
        
        //initialize the base layer panel
        this.setLayout(new BorderLayout());
        this.setOpaque(false);
        JPanel base_layer = new JPanel();
        base_layer.setLayout(new GridBagLayout());
        base_layer.setOpaque(false);
        GridBagConstraints c = new GridBagConstraints();
        
        //Build each of the level two layers        
        JPanel panel_orbs_000      = new OrbPanel();
        panel_orbs_000.setBorder(BorderFactory.createLineBorder(Color.pink  ));
        panel_orbs_000.setOpaque(false);
        panel_orbs_000.setPreferredSize(new Dimension((int)(getWidth()*1.00), (int)(getHeight()*0.10)));
        
        JPanel panel_introArea_001 = new JPanel();
        panel_introArea_001.setBorder(BorderFactory.createLineBorder(Color.green));
        panel_introArea_001.setOpaque(false);
        panel_introArea_001.setPreferredSize(new Dimension((int)(getWidth()*1.00), (int)(getHeight()*0.60)));
        
        JPanel panel_muse_002      = new MuseWidget();
        panel_muse_002.setBorder(BorderFactory.createLineBorder(Color.blue));
        panel_muse_002.setOpaque(false);
        panel_muse_002.setPreferredSize(new Dimension((int)(getWidth()*0.50), (int)(getHeight()*0.30)));
        
        JPanel panel_museChat_003  = new ChatBubbleWidget();
        panel_museChat_003.setBorder(BorderFactory.createLineBorder(Color.red));
        panel_museChat_003.setOpaque(false);
        panel_museChat_003.setPreferredSize(new Dimension((int)(getWidth()*0.50), (int)(getHeight()*0.30)));
        
        //Add each of the level two layers to the base layer  
        c.fill = GridBagConstraints.BOTH;
        c.gridx     = 0;    c.gridy      = 0;
        c.gridwidth = 10;   c.gridheight = 1;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 1.0;  c.weighty    = 1;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_orbs_000, c);
        
        c.fill = GridBagConstraints.BOTH;
        c.gridx     = 0;    c.gridy      = 1;
        c.gridwidth = 10;   c.gridheight = 6;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 1.0;  c.weighty    = 6;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_introArea_001, c);
        
        c.fill = GridBagConstraints.BOTH;
        c.gridx     = 0;    c.gridy      = 7;
        c.gridwidth = 5;    c.gridheight = 3;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 0.5;  c.weighty    = 3;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_muse_002, c);
        
        c.fill = GridBagConstraints.BOTH;
        c.gridx     = 5;    c.gridy      = 7;
        c.gridwidth = 5;    c.gridheight = 3;
        c.ipadx     = 0;    c.ipady      = 0;
        c.weightx   = 0.5;  c.weighty    = 3;
        c.insets = new Insets(0, 0, 0, 0);
        base_layer.add(panel_museChat_003, c);

        //add the base layer
        this.add(base_layer);  
                
	}
}
